-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use alpine equivalent of Docker Compose services to reduce size and startup time #4329
Conversation
I get the same test failures locally when applying this diff, super bizarre. We don't run test suites in Docker for CI, though I believe we could on travis. It may be worth investigating this. |
Seems there are a handful of issues with this interchange noted, see docker-library/postgres#276 and related issues for some sparse details about an inconsistency with |
Huh, interesting. It seems reasonable that there can be slight differences between |
I found it! If I change I still don't fully understand why this fixes it since |
I'm going to guess that this comes down to differences in locale. |
I can change the lambdas to use |
As detailed in https://wiki.musl-libc.org/functional-differences-from-glibc.html, locales aren’t supported which is the likely reason for the weird difference. I appreciate and understand the advantages of smaller images and faster startup times, but am concerned that these images will cause more headaches down the line than they will alleviate. Given that, I’m -1 on this PR. |
Thanks for the additional resources, this is all starting to make a lot more sense to me. I'm willing to concede this PR since I agree that keeping the CI and production environments similar is a worthwhile goal, but I'd like to consider one more take on these changes. To dig a bit deeper into what's actually breaking, let's take a look at what postgres is returning before and after. Before: ipdb> pprint.pprint(list(result["projects"]))
[Project(name='BIMBlgoOkHka'),
Project(name='bMmmSpgHmHIh'),
Project(name='byAXNNAdlSqO'),
Project(name='cBqRuPRfikfn'),
Project(name='CvRGYyPGJKAl'),
...] After: ipdb> pprint.pprint(list(result["projects"]))
[Project(name='CJeowjOyVFBg'),
Project(name='EKxpPcfLjHOf'),
...
Project(name='aFCsScRCyzKS'),
Project(name='dFMoMkuHlAtk'),
Project(name='dUvxzRgRVYFQ')] As you've both correctly deduced, the locale is affecting the sort order returned by postgres. Before, the sort order was solely based on the letter, regardless of case. After, the sort order first sorted upper case then sorted lower case letters. I'm not sure which is preferred from a UX perspective, I'd guess that, for example, users would expect the former in the case of a search box. However, if we ignore UX for a minute, I'd argue that the tests may be testing the wrong thing. As mentioned earlier, we could change Thoughts? |
The name field is a case insensitive field, so I think that's why it generally sorts case insensitively. |
Thanks for this PR, however after thinking it over, I'm going to agree with @ewdurbin here and say we don't want to diverge this much from our production deployment. While we can't get 1:1 parity with our production deployment, the more differences we get, the more likely we are to miss errors until they get into production. Thanks again, and sorry that we couldn't accept it! |
Hi all,
This is my first PR against
warehouse
! Let me know if anything is out of order.To reduce the size of dependencies pulled in for Docker Compose services I've changed the image's to be their Alpine equivalent. This should save something like ~400MB when downloading the images:
One thing I noticed, though, is a couple of tests fail after the move from
postgres:10.1
->postgres:10.1-alpine
. Perhaps this is just an oddity with my dev environment, so I'll be curious to see if the TravisCI tests fail. Here are the failures in question:I'm especially confused because
tests/unit/admin/views/test_users.py
has very similar tests, but those pass.Thoughts?